import request from '@/utils/request'
import { tradeApi } from '@/utils/comm'

// 查询列表
export function listServerSpu(query) {
  return request({
    url: `${tradeApi}/serverSpu/list`,
    method: 'get',
    params: query
  })
}

// 查询详情
export function getServerSpu(id) {
  return request({
    url: `${tradeApi}/serverSpu/` + id,
    method: 'get'
  })
}

// 新增
export function addServerSpu(data) {
  return request({
    url: `${tradeApi}/serverSpu`,
    method: 'post',
    data: data
  })
}

// 修改
export function updateServerSpu(data) {
  return request({
    url: `${tradeApi}/serverSpu`,
    method: 'put',
    data: data
  })
}

// 删除
export function delServerSpu(ids) {
  return request({
    url: `${tradeApi}/serverSpu/` + ids,
    method: 'DELETE',
  })
}

// 更新服务spu状态
export function updateStatus(data) {
  return request({
    url: `${tradeApi}/serverSpu/updateStatus`,
    method: 'put',
    data: data
  })
}